{% extends base_template %}
{% load i18n %}

{% load xadmin_tags %}
{% load crispy_forms_tags %}

{% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %}

{% block nav_title %}{% if model_icon %}<i class="{{model_icon}}"><sub class="fa fa-{% if add%}plus{%else%}pencil{%endif%}"></sub></i> {% endif %}
{{ title }}{% endblock %}


{% block nav_middle %}
{% if change %}
<form id="changelist-form" action="{% url opts|admin_urlname:'changelist' %}" method="post">{% csrf_token %}
    <input name="_selected_action" type="hidden" value="{{ original.pk }}" />
    <input type="hidden" id="action" name="action" value=""/>
    {% view_block 'results_bottom' %}
    {% if show_delete_link %}
      <a href="{{ delete_url }}" class="btn btn-sm btn-default">{% trans "Delete" %}</a>
    {% endif %}
</form>
{% endif %}
{% endblock %}

{% block nav_btns %}
{% include "xadmin/includes/form_btn.html" %}
{% if change and cl.log %}
<a href="{% url 'xadmin:index' %}admin/logentry/?_p_content_type={{ content_type_id }}&_p_object_id={{ original.pk }}" class="btn"><i class="fa fa-eye"></i> 历史</a>
{% endif %}
{% endblock nav_btns %}

{% block content %}
<form class="exform" onsubmit="$.do_submit()" {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.module_name }}_form">{% csrf_token %}
  {% block form_top %}{% endblock %}
  {% view_block 'form_top' %}

  {% if errors %}
      <div class="alert alert-danger alert-dismissable">
        <button type="button" class="close" data-dismiss="alert">&times;</button>
      {% blocktrans count counter=errors|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
      </div>
      {{ form.non_field_errors }}
  {% endif %}

  {% view_block 'before_fieldsets' %}

  {% crispy form %}

  {% view_block 'after_fieldsets' %}

  {% block submit_buttons_bottom %}{% include "xadmin/includes/submit_line.html" %}{% endblock %}
</form>



{% endblock %}
